package com.somlsis.dialog

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.DialogFragment
import com.somlsis.R

class BluetoothHintDialog(val listener: OnBluetoothButtonClickListener) : DialogFragment() {
    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        val inflate = inflater.inflate(R.layout.dialog_bluetooth, container)
        val confirm = inflate.findViewById<TextView>(R.id.confirm)
        val cancel = inflate.findViewById<TextView>(R.id.cancel)
        confirm.setOnClickListener {
            listener.onGoToSettingsClick()
            dismiss()
        }
        cancel.setOnClickListener{
            listener.onCancelClick()
            dismiss()
        }
        return inflate
    }
    interface OnBluetoothButtonClickListener {
        fun onGoToSettingsClick()
        fun onCancelClick()
    }
}